package com.base.frame.baseframe.controller;

import com.alibaba.fastjson.JSONObject;
import com.base.frame.baseframe.domain.StudentSource;
import com.base.frame.baseframe.service.IStudentSourceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @ClassName DeomController
 * @Author FangShanShan
 * @Description 示例controller
 * @Date 2020/5/9 17:42
 */
@Slf4j
@Controller
@RequestMapping("/demo")
public class DeomController {

    @Autowired
    private IStudentSourceService studentSourceService;

    @RequestMapping("/index")
    public String index() {
        List<StudentSource> list = studentSourceService.selectAll();
        log.info("<<< 查询返回信息[{}] \n [{}]", list.toString(), JSONObject.toJSONString(list));

        return "index";
    }
}